//
//  TranslationView.m
//  HotWord
//
//  Created by Rainbow on 1/15/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "TranslationView.h"
#define ENGLISH_LABEL_HEIGHT  45

@implementation TranslationView
@synthesize chineseLabel;
@synthesize englishLabel;

- (void)setChinese:(NSString *)cn andEnglish:(NSString *)en
{
    self.chineseLabel.text = cn;
    NSInteger englishLabelHeight = [en sizeWithFont:self.englishLabel.font constrainedToSize:CGSizeMake(self.englishLabel.width, ENGLISH_LABEL_HEIGHT) lineBreakMode:UILineBreakModeWordWrap].height;
    self.englishLabel.text = en;
    self.englishLabel.height = englishLabelHeight;
    self.englishLabel.top = self.chineseLabel.top + self.chineseLabel.height + (ENGLISH_LABEL_HEIGHT - englishLabelHeight)/2;
}

- (void)dealloc {
    [chineseLabel release];
    [englishLabel release];
    [super dealloc];
}
@end
